<?php
ini_set ("display_errors", "1");
error_reporting(E_ALL);
  $time = microtime();
  $time = explode(' ', $time);
  $time = $time[1] + $time[0];
  $start = $time;
  if (!file_exists("../config.php")) {
      echo "Missing config.php";
      die;
  }
  $pageTitle="";
  $fid = "";
  $page = "";
  $qqq = 0;
  $lang = "";
  $return = "";
  if (!isset($_GET['del'])) {$_GET['del']= "";}
  if (!isset($_GET['backup'])) {$_GET['backup']= "";}
  include("../config.php");
  include("../lang/english.php");
  include('../class/class.database.php');
  $db = new database($server, $username, $password, $database);
  $db->connect(database);
  //user_level 1 is reserved for admins only. user_level 2 or 3 etc. is for moderators
  if ($_SESSION['user_level'] != 1 or (!$_SESSION['signed_in'])) {
      header("location: redirect.php");
  } else {
      $admin_home = "<img src = 'style/default/admin_cp.gif'> AdminCP | " . $l_forumname . "";
      
	  if (isset($_GET['f'])) {$fid = mysql_real_escape_string($_GET['f']);} 
	  
	  if (isset($_GET['page'])) {$page = mysql_real_escape_string($_GET['page']);} 
	  
      $tags = array('{STYLE}', '{START}', '{F_NAME}', '{F_HOME}', '{A_HOME}', '{CREATE_T}', '(CREATE_T_L)', '{MEMBERS}', '{IF_LOGIN}', '{END_IF}', '{IF_NOT_LOGIN}', '{END_NOT}', '(SEARCH)', '{P_ID}');
      $data = array('default', ob_start(), $admin_home, 'Forum index', 'ACP', $l_new_topic, 'create_topic.php?f=' . $fid . '', 'Members', '<!--', '-->', '', '', $page);
      
      if ($_SESSION['signed_in']) {
          $tags = array('{STYLE}', '{START}', '{F_NAME}', '{F_HOME}', '{A_HOME}', '{CREATE_T}', '(CREATE_T_L)', '{MEMBERS}', '{IF_LOGIN}', '{END_IF}', '{HELLO}', '{USER_SID}', '{L_NOTU}', '{SIGNOUT}', '{IF_NOT_LOGIN}', '{END_NOT}', '{P_ID}');
          $data = array('default', ob_start(), $admin_home, 'Forum index', 'ACP', $l_new_topic, 'create_topic.php?f=' . $fid . '', 'Members', '', '', $l_hello, htmlentities($_SESSION['user_name']), $l_notu, $l_signout, '<!--', '-->', $page);
      } else {
          $tags = array('{STYLE}', '{START}', '{F_NAME}', '{F_HOME}', '{A_HOME}', '{CREATE_T}', '(CREATE_T_L)', '{MEMBERS}', '{IF_LOGIN}', '{END_IF}', '{LOGIN}', '{OR}', '{REGISTER}', '{F_ID}', '(T_ID)', '{IF_NOT_LOGIN}', '{END_NOT}', '{P_ID}');
          $data = array('default', ob_start(), $admin_home, 'Forum index', 'ACP', $l_new_topic, 'create_topic.php?f=' . mysql_real_escape_string($_GET['f']) . '', 'Members', '<!--', '-->', $l_login, $l_or, $l_register, mysql_real_escape_string($_GET['f']), mysql_real_escape_string($_GET['t']), '', '', $page);
      }
      echo str_replace($tags, $data, file_get_contents("./style/default/header.html"));
?>

    <div id="content">
   <a class="menuButtons" href = "forums.php">Forums</a>
<a class="menuButtons" href = "posts.php">Posts</a>
<a class="menuButtons" href = "users.php">Users</a>
<a class="menuButtons" href = "registration.php">User registration settings</a> 
<a class="menuButtons" href = "bans.php">Bans</a> 
<a class="menuButtons" href = "style.php">Style</a>
<a class="menuButtons" href = "permission.php">Permissions</a> 
<a class="menuButtons" href = "word_filter.php">Word filter</a> 
<a class="menuButtons" href = "email.php">Email Settings</a> 
<a class="menuButtons" href = "conf.php">DB Configuration</a>
<a class="menuButtons" href = "adsense.php">Adsense</a>
 <br /><br /><hr><br />

<?php
  }
  /*
   echo "<table><tr>";
   if($_SESSION['signed_in'] == true)
   {
   echo " <td class='headerBar' align='left'><a href='../view_new.php?sort=desc'>View new posts</a></td>";
   }
   if($_SESSION['signed_in'] == true AND $_SESSION['user_level'] == 1 )
   {
   echo " <td class='headerBar' align='right'><a href=\"../create_cat.php\">". $l_create_category. "</a></td>";
   }
   echo "</tr></table>";
   */
?>